//
//  WzzCenterZdyBut.m
//  Wb_oc
//
//  Created by wzz on 16/7/28.
//  Copyright © 2016年 wzz. All rights reserved.
//

#define SIZEW self.frame.size
#import "WzzCenterZdyBut.h"

@implementation WzzCenterZdyBut

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{

    //self.backgroundColor = [UIColor redColor];
    self.contentMode = UIViewContentModeCenter;
    // 设置tilte
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    [self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [self sizeToFit];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.imageView.frame = CGRectMake(0, 0, SIZEW.width, SIZEW.width);
    self.titleLabel.frame = CGRectMake(0, SIZEW.width, SIZEW.width, SIZEW.height - SIZEW.width + 10);
}

@end
